using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Xml;

namespace My.IdlConverter.Core.Config
{
    public class EnvironmentConfig
    {
       public static string ConfigFile = "./configuration/sdk/Environment.config";

        private XmlDocument cfgDocument = new XmlDocument();

        public EnvironmentConfig()
        {
            cfgDocument.Load(ConfigFile);
        }

        #region config properties
        public string IdlConverterpath
        {
            get
            {
                XmlNode node = cfgDocument.SelectSingleNode("//Setting/IdlConverterPath");

                return node.InnerText;
            }
            set
            {
                XmlNode node = cfgDocument.SelectSingleNode("//Setting/IdlConverterPath");

                node.InnerText = value;
            }
        }
        #endregion

        #region behavior
        public void Save()
        {
            cfgDocument.Save(ConfigFile);
        }
        #endregion
    }
}
